// 1.导入路由
import { createRouter, createWebHashHistory } from 'vue-router'

import Index from '../components/index.vue'
import Emp from '../components/emp.vue'
import Other from '../components/other.vue'

// 2.路由配置
const routes = [
    {
        path :"/",
        component :Index,
        children:[
            {
                path :"/emp",
                component :Emp
            },
            {
                path :"/other",
                component :Other
            }
        ],
    }
]

// 3.创建路由
const router = createRouter({
    history:createWebHashHistory(),
    // routes:routes
    // key和value一样，可以省略
    routes
})
// 4.导出路由
export default router

